// armISPV1_0Dlg.h : header file
//

#if !defined(AFX_ARMISPV1_0DLG_H__06958CD2_3647_4B8A_8716_EF0AB2B41E07__INCLUDED_)
#define AFX_ARMISPV1_0DLG_H__06958CD2_3647_4B8A_8716_EF0AB2B41E07__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


/////////////////////////////////////////////////////////////////////////////
// CArmISPV1_0Dlg dialog

class CArmISPV1_0Dlg : public CDialog
{
// Construction
public:
	BOOL	CopyRAM2Flash(int nFlashAddr,int nRAMAddr,int nByteCount);
	BOOL	CompareRAMAndFlash(int nFlashAddr, int nRAMAddr, int nByteCount);
	CArmISPV1_0Dlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CArmISPV1_0Dlg)
	enum { IDD = IDD_ARMISPV1_0_DIALOG };
	CButton	m_CheckEnableZK;
	CButton	m_bCheckComOpen;
	CComboBox	m_cbSelDevice;
	CButton	m_CheckAfterLoad;
	CComboBox	m_cbXtalFreq;
	CButton	m_AutoRunAfterOpenFile;
	CComboBox	m_FileName;
	CProgressCtrl	m_ProgressBar;
	CComboBox	m_cbSelBaudrate;
	CComboBox	m_cbSelectCOM;
	int		m_nStartSector;
	int		m_nEndSector;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CArmISPV1_0Dlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	BOOL SendAndWaitString(char* pSendStr,char* pWaitStr);
	void	SaveSetting();
	void	GetSetting();
	BOOL	Send2RamAndCopy2Flash(int	nTotalSendLen,
							  BYTE	pbinBuf[],
							  int	nBase,
							  BOOL	bIsCopy);
	BOOL OpenHexFile(CString hexFileName,BYTE data[],int &addrMax);
	BOOL EncodeAndSend(BYTE* pbinBuf,int	nLen);
	BOOL ChangeFlash(char ucCommand,int	nStartBase,int	nEndBase);
	BOOL ISPSynchroniz();
	HICON m_hIcon;
	
	UINT	m_nMyPort;
	UINT	m_nBaudrate;
	int		m_nPromgrammingStatus;
	// Generated message map functions
	//{{AFX_MSG(CArmISPV1_0Dlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnReadChipID();
	afx_msg void OnOpenFile();
	afx_msg void OnUploadFlash();
	afx_msg void OnDestroy();
	afx_msg void OnCheckData();
	afx_msg void OnSelchangeFilePath();
	afx_msg void OnErase();
	afx_msg void OnBlankCheck();
	afx_msg void OnComOpen();
	afx_msg void OnComClose();
	afx_msg void OnLoadHzkBpm();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_ARMISPV1_0DLG_H__06958CD2_3647_4B8A_8716_EF0AB2B41E07__INCLUDED_)
